<?php
/**
 * Created by PhpStorm.
 * User: yxs
 * Date: 2017/4/17
 * Time: 15:49
 */

namespace validate;


use think\Validate;

class Account extends Validate
{
    protected $rule = [
        "nick" => "require|unique:account",
        'email'=>"email",
        "password"=>"require",
        'name'=>'require',
        'mobile'=>'require',
        'wechat'=>'require'
    ];

    protected $message = [
        "nick.unique"=>"昵称已存在",
        "nick.require"=>"请输入昵称",
        "password.require"=>"请输入密码",
        "email"=>"邮箱格式错误",
        'name'=>'请输入名称',
        'mobile'=>'请输入手机号',
        'wechat'=>'请输入微信号'
    ];

    protected $scene = [
        'add'=>['nick','email','password'],
        'edit'  =>  ['name','mobile','wechat'],
    ];
}